package com.example.zhuye;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.Toast;

import com.example.zhuye.studentclass_check_tea;
import com.example.xueshengxinxi.xueshengxinxi;
import com.example.tongji.TimutongjiList;
import com.example.xuetang.R;

public class OneFragment extends Fragment {
	private ImageButton myButton, btn, homework, chengji, xueshengxinxi, bt6,
			bt7, bt8;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.one, container, false);//
		myButton = (ImageButton) rootView.findViewById(R.id.img_bt1);//
		// 跳转到答题界面
		myButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getActivity(),
						com.example.tixing.Dati.class);
				startActivity(intent);

			}
		});
		// 跳转到提问界面
		btn = (ImageButton) rootView.findViewById(R.id.tiwen);// 锟斤拷锟斤拷rootView锟揭碉拷button
		// 锟斤拷锟矫帮拷锟斤拷锟斤拷锟斤拷锟铰硷拷
		btn.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent wenda = new Intent(getActivity(),
						com.example.forquestion.Wenti.class);
				startActivity(wenda);
			}
		});

		// 跳转到作业的页面
		homework = (ImageButton) rootView.findViewById(R.id.zuoye);
		homework.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent zuoye = new Intent(getActivity(),
						com.example.homework.Homework.class);
				startActivity(zuoye);
			}
		});

		// 成绩统计
		chengji = (ImageButton) rootView.findViewById(R.id.img_bt2);
		chengji.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// Toast.makeText(OneFragment.this.getActivity(),
				// "button is click!", Toast.LENGTH_SHORT).show();
				// TODO Auto-generated method stub
				Intent intent_tongji = new Intent(getActivity(),
						TimutongjiList.class);
				startActivity(intent_tongji);
			}
		});

		// 查看学生信息,点击了设置后
		xueshengxinxi = (ImageButton) rootView.findViewById(R.id.img_bt4);
		xueshengxinxi.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(OneFragment.this.getActivity(),
						"抱歉，暂不支持此功能，等待以后更新。。。", Toast.LENGTH_SHORT).show();
				// TODO Auto-generated method stub
				// Intent xueshengList = new
				// Intent(getActivity(),studentclass_check_tea.class);
				// startActivity(xueshengList);
			}
		});
		
		

		return rootView;
	}

	@Override
	public void onPause() {
		super.onPause();
	}

	@Override
	public void onResume() {
		super.onResume();
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
	}

	@Override
	public void onDestroyView() {
		super.onDestroyView();
	}

	@Override
	public void onStop() {
		super.onStop();
	}

	@Override
	public void onStart() {
		super.onStart();
	}

}
